<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('材料费用项目详情')" />
</head>
<body class="gray-bg">
<div style="background-color: white">
    <a class="btn btn-info btn-outline visible-xs-block" href="#" onclick="$.modal.closeTab()">返&nbsp;回</a>
</div>
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId" th:object="${pId}">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>材料类型：</label>
                                <input type="text" name="mName"/>
                            </li>
                            <li>
                                <label>材料数量：</label>
                                <input type="text" name="mNum"/>
                            </li>
                            <li class="select-time">
                                <label>创建时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginMTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endMTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
         var id=[[${pId}]]
         var removeFlag = [[${@permission.hasPermi('ruoyi:requisition:remove')}]];
         var prefixs = ctx + "ruoyi/requisitions";
         $(function(){
             var options = {
                 url: prefixs + "/list",
                 exportUrl: prefixs + "/export",
                 modalName:"",
                 showFooter: true,
                 method: 'post',
                 sidePagination: "server",
                 contentType: "application/x-www-form-urlencoded",
                 sortName:'mTime',
                 sortOrder:'desc',
                 striped: true,
                 showColumns: false,
                 queryParams: {
                     mId:id
                 },
                 columns: [
                     {
                         field: 'id',
                         title: '材料id',
                         visible: false
                     },
                     {
                         field: 'mName',
                         title: '材料类型'
                     },
                     {
                         field: 'mNum',
                         title: '材料数量'
                     },
                     {
                         field: 'mApplicant',
                         title: '申请人'
                     },
                     {
                         field: 'mTime',
                         title: '创建时间',
                         sortable: true
                     },
                     {
                         field: 'mStatus',
                         title: '审批状态',
                         // formatter: function(value, row, index) {
                         //     return $.table.selectDictLabel(#, value);
                         // }
                     }]
             };
             $.table.init(options);
         });
     </script>
</body>
</html>